import request from '@/utils/request'
// 分页查询
export function listOrderByPage(data) {
  return request({
    url: '/order/page',
    method: 'get',
    params: data
  })
}

// 查询订单数据
export function getOrderInfo(orderId) {
  return request({
    url: '/order/' + orderId,
    method: 'get'
  })
}

// 修改数据
export function updateOrderInfo(params) {
  return request({
    url: '/order/editOrder',
    method: 'get',
    params: params
  })
}

// 取消全部订单
export function cancelOrder(params) {
  return request({
    url: '/order/cancelOrder',
    method: 'get',
    params: params
  })
}

// 取消单个订单
export function cancelRoom(params) {
  return request({
    url: '/order/cancelRoom',
    method: 'get',
    params: params
  })
}

// // 支付宝支付端口
// export function getAlipay(data) {
//   return request({
//     url: '/pay/alipay',
//     method: 'get',
//     data: data
//   })
// }

// 退房端口
export function roomCheckOut(params) {
  return request({
    url: '/pay/checkOut',
    method: 'get',
    params: params
  })
}

// 现金接口
export function cashPay(data) {
  return request({
    url: '/pay/cashPay',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 可入住的房号
export function checkInRoomId(params) {
  return request({
    url: '/order/checkIn',
    method: 'get',
    params: params
  })
}

// 办理入住
export function checkInRoom(params) {
  return request({
    url: '/order/confirmCheckIn',
    method: 'get',
    params: params
  })
}

// 判断订单是否支付押金
export function judgePayDeposit(data) {
  return request({
    url: '/pay/judgeDeposit',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 现金支付押金
export function payDepositByCash(data) {
  return request({
    url: '/pay/payDepositByCash',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 押金计算
export function calculateDeposit(data) {
  return request({
    url: '/pay/calculateDeposit',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
